package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpYAccountCustomerDetailsDefaultPageUtil extends SeleniumPageUtil {
	public final static By YACD_SPAN_HEADER = By.id("ParentChildContainer_CustomerHeader1_lblHdr");
	public final static By YACD_LINK_EDIT = By.id("ParentChildContainer_CustomerHeader1_btnEdit");
	public final static By YACD_TD_CUSTOMER_NAME = By.xpath("//*[@id='ParentChildContainer_CustomerHeader1_divCustomerInfo']/table/tbody/tr[1]/td[1]");
	public final static By YACD_INPUT_CUSTOMER_NAME = By.id("ParentChildContainer_CustomerHeader1_txtCustomerName");
	public final static By YACD_TD_IS_SMS = By.xpath("//*[@id='ParentChildContainer_CustomerHeader1_divCustomerInfo']/table/tbody/tr[1]/td[3]");
	public final static By YACD_INPUT_IS_SMS = By.id("ParentChildContainer_CustomerHeader1_chkIsSms");
	public final static By YACD_TD_CUSTOMER_ID = By.xpath("//*[@id='ParentChildContainer_CustomerHeader1_divCustomerInfo']/table/tbody/tr[2]/td[1]");
	public final static By YACD_INPUT_CUSTOMER_ID = By.id("ParentChildContainer_CustomerHeader1_txtCustomerShortName");
	public final static By YACD_TD_IS_PARTNER = By.xpath("//*[@id='ParentChildContainer_CustomerHeader1_divCustomerInfo']/table/tbody/tr[2]/td[3]");
	public final static By YACD_INPUT_IS_PARTNER = By.id("ParentChildContainer_CustomerHeader1_chkIsPartner");
	
	public final static By YACD_TAB_ALIASES = By.id("ParentChildContainer_tabMenu_ParentChildContainer_tabMenuLB_f2e69e4a-2022-49d9-801d-f69d70190c60");
	public final static By YACD_TAB_USERS = By.id("ParentChildContainer_tabMenu_ParentChildContainer_tabMenuLB_e582425c-7246-4514-86bf-5babaa9132f9");
	public final static By YACD_TAB_ADDRESSES = By.id("ParentChildContainer_tabMenu_ParentChildContainer_tabMenuLB_590fcbe6-0ece-4ddb-b57a-bdcd8727ae35");
	public final static By YACD_TAB_CONTACTS = By.id("ParentChildContainer_tabMenu_ParentChildContainer_tabMenuLB_cd2a67b9-1db4-4933-88d4-dd151399f788");
	public final static By YACD_TAB_GROUPS = By.id("ParentChildContainer_tabMenu_ParentChildContainer_tabMenuLB_11079b94-91b4-48ec-a933-cbac20624474");
	public final static By YACD_TAB_PARTNERS = By.id("ParentChildContainer_tabMenu_ParentChildContainer_tabMenuLB_3dcf4a87-5639-4114-8432-81ac80444c1c");
	public final static By YACD_TAB_NOTES = By.id("ParentChildContainer_tabMenu_ParentChildContainer_tabMenuLB_f45c5735-a8bf-4250-ac17-39d5ecd7ded1");
	public final static By YACD_TAB_EMAIL_NOTIFICATIONS = By.id("ParentChildContainer_tabMenu_ParentChildContainer_tabMenuLB_492cb6e0-a613-41c5-8150-d2b3550e2cf9");
	
	public final static By YACD_IMG_FILTER = By.id("ParentChildContainer_CustomerDetails_Aliases1_AliasReport_filter_0");
	public final static By YACD_INPUT_CONTENT = By.id("ParentChildContainer_CustomerDetails_Aliases1_AliasReport_txtFilterInput");
	public final static By YACD_BUTTON_ENTER = By.id("ParentChildContainer_CustomerDetails_Aliases1_AliasReport_btnFilterEnter");
	public final static By YACD_BUTTON_CANCEL = By.id("ParentChildContainer_CustomerDetails_Aliases1_AliasReport_btnFilterCancel");
	public final static By YACD_BUTTON_CLEAR = By.id("ParentChildContainer_CustomerDetails_Aliases1_AliasReport_btnFilterCancel");
	public final static By YACD_SPAN_RESULTS = By.id("ParentChildContainer_CustomerDetails_Aliases1_AliasReport_ReportOutput");
	
	
	public static void enterYourAccountCustomerDetailsDefaultPage(){
		SpHomePageUtil.enter();
		SpHomePageUtil.changeCustomer("SMS MASTER");
		SpHomePageUtil.enterYourAccountCustomerDetailsDefaultPage();
	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				YACD_LINK_EDIT, YACD_TAB_USERS, YACD_TAB_ADDRESSES, YACD_TAB_CONTACTS, YACD_TAB_GROUPS,
				YACD_TAB_PARTNERS, YACD_TAB_NOTES, YACD_TAB_EMAIL_NOTIFICATIONS
			});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YACD_LINK_EDIT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YACD_TAB_USERS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YACD_TAB_ADDRESSES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YACD_TAB_CONTACTS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YACD_TAB_GROUPS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YACD_TAB_PARTNERS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YACD_TAB_NOTES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YACD_TAB_EMAIL_NOTIFICATIONS));
	}
}
